package cj.web.yc.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cj.web.yc.dao.WatchHistoryDAO;
import cj.web.yc.domain.WatchHistory;

@Service
public class WatchHistoryService {

	@Autowired
    private WatchHistoryDAO watchHistoryDAO;
	
	/**
	 * 查询
	 * @param watchHistory
	 * @return watchHistorylis;size
	 */
	public Map query(WatchHistory watchHistory){
		Map rep = new HashMap();
		List<WatchHistory> watchHistorylis = watchHistoryDAO.query(watchHistory);
		int size = watchHistoryDAO.querySize(watchHistory); 
		rep.put("watchHistorylis", watchHistorylis);
		rep.put("size", size);
		return rep;
    }
	
	public WatchHistory queryById(int id){
		WatchHistory obj = watchHistoryDAO.queryById(id);
		return obj;
    }
	
	public void create(WatchHistory watchHistory){
		watchHistoryDAO.create(watchHistory);
	}
}